package com.moyu.user.mapper.role;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.moyu.user.domain.role.Role;
import com.moyu.user.domain.role.dto.RoleQueryDTO;
import com.moyu.user.domain.role.vo.RoleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 角色随机层
 *
 * @Author 赵彦博
 * @Date 2024/12/27 15:27
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    List<RoleVO> selectRoleList(RoleQueryDTO roleQueryDTO);

    List<RoleVO> selectRoleListByUserId(RoleQueryDTO roleQueryDTO);

    List<RoleVO> selectRoleListByUserIdAll(Long id);

    int addRoleWithUser(@Param("userId") Long id, @Param("roles")  List<RoleVO> roles);

    int deleteAllById(Long id);

    List<Long> selectUserAndRoleById(Long id);
}
